<?php
//-------------------------------------------------------
require_once("../includes/config.php");
require_once("../includes/class/contenido.class.php");
require_once("../includes/fckeditor/fckeditor_php5.php");
require_once("includes/secure.php");
//-------------------------------------------------------

$contenido = new Contenido();

if(isset($_POST['agregar']) && $_POST['agregar']==1)
{
	//$contenido->texto = $_POST['descripcion1'];
	$contenido->actualizarDatosContenido($_POST['codDescrip1'],$_POST['descripcion1']);
	$contenido->actualizarDatosContenido($_POST['codDescrip2'],$_POST['descripcion2']);
	
	$delay=0;
	$url="content.php";
	echo "<script>alert('The registration has been successfully')</script>";
	echo "<meta http-equiv='Refresh' content='$delay; url=$url'>";
	//header("location: content.php");
}
else
{		
	$mod = $_GET['mod'];
	
	$desc_es1 = new FCKeditor('descripcion1');
	//$desc_es->ToolbarSet = "Basic";
	$desc_es1->ToolbarSet = "Default";
	$desc_es1->Height = "300";
	$desc_es1->Width = "850";	
	
	$lista = $contenido->obtenerDatosContenido($mod);
	
	$desc_es1->Value = $lista[0]->texto;		
}

?>